package com.wrb.manage.service;

import com.wrb.manage.mapper.CustomerMapper;
import com.wrb.manage.model.Customer;
import com.wrb.manage.model.CustomerCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wrb
 * @date 2019/12/5 14:41
 */
@Service
public class CustomerService {

	@Autowired
	private CustomerMapper customerMapper;

	public Customer getByKey(long customerId) {
		return this.customerMapper.selectByPrimaryKey(customerId);
	}

	public List getList() {
		CustomerCriteria criteria = new CustomerCriteria();
		criteria.setOrderByClause(" create_time desc");
		return this.customerMapper.selectByExample(criteria);
	}
}
